<template>
	<view>
		<view class="item" style="padding: 20rpx;">

			<u-form ref="uform" label-width="auto">
				<u-form-item label="车牌号" borderBottom required>
					<u-input v-model="carNo" inputAlign="right" border="none"
						placeholder="请输入车牌号">
					</u-input>
				</u-form-item>
				<u-form-item label="车架号" borderBottom>
					<u-input v-model="vinNo" inputAlign="right" border="none"
						placeholder="请输入车架号">
					</u-input>
				</u-form-item>

				<view class="bottom">
					<text @click="commit">查 询</text>

				</view>
			</u-form>
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				carNo:'',
				vinNo:'',
			}
		},
		methods: {
			commit(){
				if(uni.$u.test.isEmpty(this.carNo)){
					this.$u.toast('请输入车牌号')
					return
				}
				
				this.$u.api.getIllegalQueryDetail({
					carNo:this.carNo,
					vinNo:this.vinNo,
				}).then(res=>{
					
					getApp().globalData.illegaldetail = res;
					
					uni.navigateTo({
						url:'/pages/illegal/illegaldetail?carNo='+this.carNo+'&comeType=1'
					})
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.bottom {
		width: 100%;
		height: 100rpx;
		background-color: white;
		display: flex;
		align-items: center;
		justify-content: center;
		margin-top: 80rpx;

		text {
			width: 98%;
			height: 80rpx;
			line-height: 80rpx;
			border-radius: 50rpx;
			background-color: $blue15;
			color: white;
			text-align: center;
			font-size: 30rpx;
		}
	}
</style>
